{include file="include:header" /}
<body class="fixed-sidebar full-height-layout gray-bg" >
    <!-- 导航 -->
    <div class="row wrapper border-bottom white-bg page-heading consult-list">
        <div class="col-sm-4">
            <h2>咨询列表</h2>
            <ol class="breadcrumb">
                <li><a href="{:url('admin/Index/home')}">主页</a></li>
                <li><a href="#">咨询管理</a></li>
                <li><strong>咨询列表</strong></li>
            </ol>
        </div>

    </div>
    <!-- 内容 -->
   <div class="wrapper wrapper-content">
        <div class="row">
            <!-- 搜索部分 -->
            <div class="col-sm-6">
                <div class="panel panel-default" >
                    <div class="panel-heading">快速查询</div>
                    <div class="panel-body">
                        <form class="form-horizontal search-form" action="" method="get" id="transmit">
                            <div class="form-group">
                                <label class="col-xs-2 control-label">用户手机号</label>
                                <div class="col-xs-10 ">
                                    <input type="text" class="form-control" name="uid" value="{$post['uid']?$post['uid']:''}" placeholder="用户手机号">
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-xs-2  control-label">咨询类型</label>
                                <div class="col-xs-10 ">
                                    <select class="form-control m-b" name="consult_type_id">
                                        <option value="">全部</option>
                                        {if condition="$post['consult_type_id'] eq ''"}
                                            {volist name="type_list" id="tv"}
                                                    <option value="{$tv['consult_type_id']}" >{$tv['ct_name']}</option>
                                            {/volist}
                                        {else /}
                                        {volist name="type_list" id="tv"}
                                            <option value="{$tv['consult_type_id']}" {if condition="$post['consult_type_id'] eq $tv['consult_type_id']"}selected="selected" {/if}>{$tv['ct_name']}</option>
                                        {/volist}
                                        {/if}
                                    </select>
                                </div>
                            </div>

                            <div class="form-group">
                                <label class="col-xs-2  control-label">咨询状态</label>
                                <div class="col-xs-10 ">
                                    <select class="form-control m-b" name="ct_state">
                                        <option value="">全部</option>
                                        {if condition="$post['ct_state'] eq ''"}
                                            <option value="1" >可显示</option>
                                            <option value="2" >已禁止</option>
                                        {else /}

                                        <option value="1" {if condition="$post['ct_state'] eq 1"}selected="selected" {/if}>可显示</option>
                                        <option value="2" {if condition="$post['ct_state'] eq 2"}selected="selected" {/if}>已禁止</option>
                                        {/if}
                                    </select>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-xs-2 control-label">咨询时间</label>
                                <div class="col-xs-10 ">
                                    <input  type="text" name="stime"  size="18" value="{$post.stime?$post.stime:''}" placeholder="开始" class=" form-control scinput" style="width: 140px;" onclick="laydate({istime: true, format: 'YYYY-MM-DD hh:mm:ss'})" />&nbsp;&nbsp;
                                    <br/><input type="text" name="otime" size="18" value="{$post.otime?$post.otime:''}" placeholder="结束" class=" form-control scinput" style="width: 140px;" onclick="laydate({istime: true, format: 'YYYY-MM-DD hh:mm:ss'})" />
                                </div>
                            </div>
                            <div class="hr-line-dashed"></div>
                            <a href="javascript:;" ><input type="button" value="搜索" class="search-btn mg-right-10 col-xs-offset-4 btn btn-primary consult-search" /></a>
                            &nbsp;&nbsp;

                            <a href="javascript:;" class="reset-search-btn btn btn-outline btn-default consult-table">导出表格</a>
                        </form>
                    </div>
                </div>
            </div>
            
        </div>
            <table class="table table-bordered white-bg">
                <thead>
                    <tr>
                        <th>咨询ID</th>
                        <th>咨询用户</th>
                        <th style="width: 200px;">咨询标题</th>
                        <th>咨询类型</th>
                        <th>咨询状态</th>
                        <th style="width: 200px;">咨询问题</th>
                        <th>咨询时间</th>
                        <th>操作</th>
                    </tr>
                </thead>
                <tbody>
                   {volist name="list" id="v"}
                   <tr>
                        <td>{$v['consult_id']}</td>
                        <td><span class="btn btn-xs btn-primary">{$v['u_nickname']?$v['u_nickname']:$v['u_phone']}</span></td>
                        <td>{$v['ct_title']}</td>
                        <td>{$v['ct_name']}</td>
                        <td>{if condition="$v['ct_state'] eq 1"}<span class="btn btn-xs btn-danger">可显示{else/}<span class="btn btn-xs btn-success">已禁止{/if}</span></td>
                        <td>{$v['ct_details']}</td>
                        <td>{$v['ct_addtime']}</td>
                        <td>
                            <a class="btn-primary btn-xs btn btn-outline" href="{:url('admin/Consul/consult_datals',array('consult_id'=>$v['consult_id']))}">查看详情</a>

                            {if condition="$v['ct_state'] eq 1"}
                               &nbsp;&nbsp;<a class="btn-primary btn-xs btn btn-danger consul-handle" href="javascript:;" value="{$v['consult_id']}" name="2">禁止</a>
                            {else/}
                             &nbsp;&nbsp;<a class="btn-primary btn-xs btn btn-success consul-handle" href="javascript:;" value="{$v['consult_id']}" name="1">解除禁止</a>
                            {/if}

                        </td>
                    </tr> 
                 {/volist}
                </tbody>
            </table>
            <div class="btn-group">{$page}</div>
    </div>
</body>
</html>
{include file="include:js" /}
